GXSetViewPortParent
You can use theGXSetViewPortParent
function to assign a parent view port to a view port object.
void GXSetViewPortParent(gxViewPort target, gxViewPort parent);
- target
- A reference to the view port whose parent you want to set.
parent
- A reference to the target view port's new parent.
DESCRIPTION
TheGXSetViewPortParent
function replaces the target's parent view port with the view port specified in theparent
parameter. It also adds the target view port to the parent's list of child view ports. If the target view port is in a different view group from the new parent view port, the target view port is reassigned to the parent's view group, which also causes the target's child view ports to be assigned to the new parent's view group as well.If you set the
parent
parameter tonil
, this function sets the target view port to have no parent; the target view port then becomes the root of a new view port hierarchy.SPECIAL CONSIDERATIONS
View port hierarchies cannot contain circular references; that is, a view port cannot have itself or any of its descendents as its parent.You cannot assign a parent view port to a window view port (one attached to a Macintosh window).
The view ports in a hierarchy must all be in the same view group.
ERRORS, WARNINGS, AND NOTICES
Errors invalid_viewPort_reference viewPort_is_a_window (debugging version) viewPort_cannot_contain_itself (debugging version) SEE ALSO
For an example of the use of this function, see Listing 7-5 on page 7-47.For information about view port hierarchies and the parent view port property, see "Parent and Child View Ports" beginning on page 7-18.
To get the parent of a view port, use the
GXGetViewPortParent
function, described in the previous section.To get the child view port list of a view port, use the
GXGetViewPortChildren
function, described next. To set the child view port list of a view port, use theGXSetViewPortChildren
function, described on page 7-87.